package com.ruoyi.project.system.service.impl;

import java.util.List;

import com.ruoyi.project.system.domain.Member;
import com.ruoyi.project.system.domain.SysUser;
import com.ruoyi.project.system.mapper.MemberMapper;
import com.ruoyi.project.system.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * [会员]Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-07
 */
@Service
public class MemberServiceImpl implements IMemberService
{
    @Autowired
    private MemberMapper memberMapper;

    /**
     * 查询[会员]
     * 
     * @param id [会员]ID
     * @return [会员]
     */
    @Override
    public Member selectMemberById(Integer id)
    {
        return memberMapper.selectMemberById(id);
    }

    /**
     * 查询[会员]列表
     * 
     * @param member [会员]
     * @return [会员]
     */
    @Override
    public List<Member> selectMemberList(Member member)
    {
        return memberMapper.selectMemberList(member);
    }

    /**
     * 新增[会员]
     * 
     * @param member [会员]
     * @return 结果
     */
    @Override
    public int insertMember(Member member)
    {
        return memberMapper.insertMember(member);
    }

    /**
     * 修改[会员]
     * 
     * @param member [会员]
     * @return 结果
     */
    @Override
    public int updateMember(Member member)
    {
        return memberMapper.updateMember(member);
    }

    /**
     * 批量删除[会员]
     * 
     * @param ids 需要删除的[会员]ID
     * @return 结果
     */
    @Override
    public int deleteMemberByIds(Integer[] ids)
    {
        return memberMapper.deleteMemberByIds(ids);
    }

    /**
     * 删除[会员]信息
     * 
     * @param id [会员]ID
     * @return 结果
     */
    @Override
    public int deleteMemberById(Integer id)
    {
        return memberMapper.deleteMemberById(id);
    }

    @Override
    public SysUser getUserByOpenid(String openid){
        return memberMapper.getUserByOpenid(openid);
    }

    @Override
    public Member getByOpenid(String openid){
        return memberMapper.getByOpenid(openid);
    }

    @Override
    public Integer updateMemberWxOpenId(int intValue) {

        return memberMapper.updateMemberWxOpenId(intValue);
    }

}
